<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
</head>
<body>
    <button onclick="cj()">开始</button>
</body>
<script>
    function cj(){
        var num = prompt("请输入考试科目的数量：");
        if (num != "praseInt"){
            alert("输入的不是数字");
            return 0;
        }
        var n1 = prompt("请输入第一门考试成绩：");
        var n2 = prompt("请输入第二门考试成绩：");
        var n3 = prompt("请输入第三门考试成绩：");
        var n4 = prompt("请输入第四门考试成绩：");
        var n5 = prompt("请输入第五门考试成绩：");
        var opt = "+";
        var exp = n1 + opt + n2 + opt + n3 + opt + n4 + opt + n5;
        var result = eval(exp);
        alert(exp + "=" + result); 
    }
    
pa
</script>
</html>